
package de.dtools.n2g.note;

import java.sql.Timestamp;

import javax.swing.text.Document;

import de.dtools.n2g.core.Label;
import de.dtools.n2g.core.User;


/**
 *	@project:	note2go
 *	@author:	D.Toepel
 *	@version:	2009-08-04
 *	@note:		---
 *	
 *	Copyright (C) 2009  D.Toepel <de.dtools> {at} <gmail> {dot} <com>
 *	
 *	This program is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *	
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *	
 *	You should have received a copy of the GNU General Public License
 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *	
 */

public class EntrySet {
	
	private Integer entryID  = null;
	private Integer isPublic = -1;
	
	private Boolean isProtected = false;
	
	private String entryTitle = new String();
	private String entryNote = new String(); 
	private String entryURL = new String();
	private String entryAutor = new String();
	private Label[] entryTags = new Label[] {};
	private User[] privateUsers = new User[] {};
	private User[] privateGroups = new User[] {};
	private String entryContent = new String();
	private Timestamp dateCreated = null;
	private Timestamp dateModified = null;
	private Document entryStyledDocument = null;
	
	private TYPE entryType;
	
	
	public Integer getEntryID() {
		return entryID;
	}


	public void setEntryID(Integer entryID) {
		this.entryID = entryID;
	}


	public Integer getIsPublic() {
		return isPublic;
	}


	public void setIsPublic(Integer isPublic) {
		this.isPublic = isPublic;
	}


	public Boolean getIsProtected() {
		return isProtected;
	}


	public void setIsProtected(Boolean isProtected) {
		this.isProtected = isProtected;
	}


	public String getEntryTitle() {
		return entryTitle;
	}


	public void setEntryTitle(String entryTitle) {
		this.entryTitle = entryTitle;
	}


	public String getEntryNote() {
		return entryNote;
	}


	public void setEntryNote(String entryNote) {
		this.entryNote = entryNote;
	}


	public String getEntryURL() {
		return entryURL;
	}


	public void setEntryURL(String entryURL) {
		this.entryURL = entryURL;
	}


	public String getEntryAutor() {
		return entryAutor;
	}


	public void setEntryAutor(String entryAutor) {
		this.entryAutor = entryAutor;
	}


	public Label[] getEntryTags() {
		return entryTags;
	}


	public void setEntryTags(Label[] entryTags) {
		this.entryTags = entryTags;
	}


	public User[] getPrivateUsers() {
		return privateUsers;
	}


	public void setPrivateUsers(User[] privateUsers) {
		this.privateUsers = privateUsers;
	}


	public User[] getPrivateGroups() {
		return privateGroups;
	}


	public void setPrivateGroups(User[] privateGroups) {
		this.privateGroups = privateGroups;
	}

	public String getEntryContent() {
		return entryContent;
	}


	public void setEntryContent(String entryContent) {
		this.entryContent = entryContent;
	}


	public String getEntryType() {
		return entryType.name();
	}


	public void setEntryType(TYPE entryType) {
		this.entryType = entryType;
	}


	public Timestamp getDateCreated() {
		return dateCreated;
	}


	public void setDateCreated(Timestamp dateCreated) {
		this.dateCreated = dateCreated;
	}


	public Timestamp getDateModified() {
		return dateModified;
	}


	public void setDateModified(Timestamp dateModified) {
		this.dateModified = dateModified;
	}


	public void setEntryStyledDocument(Document entryStyledDocument) {
		this.entryStyledDocument = entryStyledDocument;
	}


	public Document getEntryStyledDocument() {
		return entryStyledDocument;
	}


	public EntrySet(){
		super();
	}
	
	public EntrySet(Boolean isTemplate){
		super();
		if (isTemplate) setTemplate();
	}
	
//	private static String iTEXT =;
	public enum TYPE {
		
		// Standards
		iTEXT {public String toString() {return "text/plain";}},
		iHTML {public String toString() {return "text/html";}},
		iRTF {public String toString() {return "text/rtf";}},
		
		// vordefiniert
		iJAVA {public String toString() {return "code/java";}},
		iCSHARP {public String toString() {return "code/csharp";}},
		iCPP {public String toString() {return "code/cpp";}},
		iTeX {public String toString() {return "code/tex";}},
		iPHP {public String toString() {return "code/php";}},
		iSQL {public String toString() {return "code/sql";}},
		iJS {public String toString() {return "code/js";}},
		
		// benutzerdefiniert
		iUSER {public String toString() {return "code/user";}};
	}
	
	private void setTemplate(){
		
		entryID = null;
		isPublic = -1;
		
		isProtected = false;
		entryType = TYPE.iRTF;
		entryTitle = "Neue Notiz - bitte speichern";
	}


}
